package com.justech.eat.service.impl;

import com.justech.eat.entity.Order;
import com.justech.eat.repository.OrderRepository;
import com.justech.eat.service.DiningRecordSupplier;
import com.justech.eat.service.OrderInternalService;
import com.justech.eat.service.component.impl.OrderSettlementTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @program: eat-service
 * @description:
 * @author: feifei.li
 * @create: 2020-06-01 17:26
 **/
@Service
public class OrderInternalServiceImpl implements OrderInternalService {
    @Autowired
    DiningRecordSupplier diningRecordSupplier;
    @Autowired
    OrderInternalService orderInternalService;
    @Autowired
    OrderSettlementTemplate orderSettlementTemplate;
    @Autowired
    OrderRepository orderRepository;

    @Override
    public List<Order> getByDate(String date) {
        return orderRepository.findByDate(date);
    }

    @Override
    public Map<String, Order> getMapByDate(String date) {
        return null;
    }

    /**
     * 结算用餐状况
     *
     * @param date
     */
    @Override
    public void settlement(String date) {
        orderSettlementTemplate.settlement(date);
    }
}
